﻿using Bll;
using Help;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Myproject.BSM
{
    public partial class main : System.Web.UI.Page
    {
        private string adminID;

        public string AdminID
        {
            get { return adminID; }
            set { adminID = value; }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (!string.IsNullOrEmpty(cookieHelp.AdminId))
                {
                    if (!new AdminBLL().ExistsByAdminName(cookieHelp.AdminName) || !new AdminBLL().ExistsByAdminId(cookieHelp.AdminId))
                    {
                        Response.Redirect("/BSM/index.aspx");
                    }
                    adminID = cookieHelp.AdminId;
                }
                else
                {
                    Response.Redirect("/BSM/index.aspx");
                }
            }
        }
    }
}